package com.project.core.base;

import java.util.StringTokenizer;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

/**
 * Base Controller初始化加载一些通用参数
 * @author dongxiaoman
 * @since 2014-06-29
 */
public class BaseController {
	
	private static Logger logger = Logger.getLogger(BaseController.class);
	
	private static final HttpServletRequest request = null;
	/** 浏览器版本号,类型 */
	private static String Agent = null;
	/** 浏览器信息 */
	private static String UserBrowser = null;
	/** 操作系统名称 */
	private static String UserOS = null;
	/** 获得客户端向服务器端传送数据的方法有GET、POST、PUT等类型 */
	private static String DataType = null;
	/** 获得发出请求字符串的客户端地址 */
	private static String ClientAddress = null;
	/** 客户端IP */
	private static String ClientIP = null;

	public BaseController() {
		/*Agent = request.getHeader("User-Agent");
		StringTokenizer st = new StringTokenizer(Agent,",");
		st.nextToken();
		UserBrowser = st.nextToken();
		UserOS = st.nextToken();
		DataType = request.getMethod();
		ClientAddress = request.getRequestURI();
		ClientIP = request.getRemoteHost();
		logger.info("Client info:["+DataType + "_" + ClientIP + "_" +UserBrowser  + "_" + UserOS  + "_" + ClientAddress +"]");*/
	}
	
	
}
